<?php

namespace System\Entity;

/**
 * 	This class contain the response for URL request
 */
class Response {

    //header is the header of page
    private $header = '';
    //content is the HTML content of page
    private $content = '';

    public function __construct($header, $content) {
        $this->setHeader($header);
        $this->setContent($content);
    }

    public function setHeader($header) {
        switch (strtoupper($header)) {
            case "HTML":
                $header = "Content-type: text/html";
                break;
            case "JSON":
                $header = "Content-type: text/json";
                break;
            default:
                $this->header = $header;
        }
    }

    public function setContent($content) {
        $this->content = $content;
    }

    public function getHeader() {
        return $this->header;
    }

    public function getContent() {
        return $this->content;
    }

}